package com.example.dbsample.model.enums;

import com.example.dbsample.model.constants.CommConstant;
import com.example.dbsample.model.http.ResultCodeV2;
import lombok.Getter;

@Getter
public enum ResultCodeEnum implements ResultCodeV2 {
    SUCCESS("0", "操作成功!"),
    SUCCESS_PART("01", "部分成功!"),
    SUCCESS_200("200", "成功!"),
    UNAUTHORIZED_401("401", "非法访问!"),
    ACCESS_TOKEN_NOT_EXIST(CommConstant.SUB_SYS_CODE + "3011", "TOKEN不存在"),
    OPERATION_INVALID(CommConstant.SUB_SYS_CODE + "9989", "非法操作"),
    REMOTE_ERROR(CommConstant.SUB_SYS_CODE + "9998", "远程调用异常"),
    SYS_ERROR(CommConstant.SUB_SYS_CODE + "9999", "非法操作"),
    ERROR("9999", "系统繁忙，请稍后重试"),
    FAILURE("4000", "操作失败!") ;

    private final String code;

    private final String msg;

    ResultCodeEnum(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
